var t = getApp();

Page({
    data: {
        language: "",
        mailLanguage: "",
        mailSingleReturnName: "",
        mailReturnDetail: "",
        mailReturnAmount: "",
        order_amount: 0,
        return_amount: 0,
        status_name: "",
        each_return_rate: 0,
        return_mode: "",
        not_return: 0,
        id: "",
        order_sn: "",
        created_at: "",
        finish_time: ""
    },
    onLoad: function(t) {
        this.initMailLanguage(), this.getData();
    },
    onReady: function() {
        var t = wx.getStorageSync("langIndex");
        this.setData({
            language: t.en
        });
    },
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {},
    initMailLanguage: function() {
        var e, a = this, n = t.getNetAddresss("setting.get-lang-setting");
        t._getNetWork({
            url: n,
            success: function(n) {
                var r = n.data;
                if (1 === r.result) {
                    e = r.data;
                    var i = t.setMailLanguage("消费赠送", e.single_return.return_detail), u = t.setMailLanguage("赠送", e.single_return.return_amount), o = t.setMailLanguage("消费队列", e.single_return.return_name);
                    a.setData({
                        mailReturnDetail: i,
                        mailReturnAmount: u,
                        mailSingleReturnName: o
                    });
                } else wx.showToast({
                    title: r.msg,
                    icon: "none"
                });
            },
            fail: function(t) {
                console.log(t);
            }
        });
    },
    getData: function() {
        var e = this, a = t.getNetAddresss("plugin.single-return.api.single-return.get-single-return-queue-detail");
        a += "&queue_id=" + this.options.id, t._getNetWork({
            url: a,
            success: function(t) {
                var a = t.data;
                1 === a.result ? e.setData({
                    order_amount: a.data.order_amount,
                    return_amount: a.data.return_amount,
                    status_name: a.data.status_name,
                    each_return_rate: a.data.each_return_rate,
                    return_mode: a.data.return_mode,
                    not_return: a.data.not_return,
                    id: a.data.id,
                    order_sn: a.data.order_sn,
                    created_at: a.data.created_at,
                    finish_time: a.data.finish_time
                }) : wx.showToast({
                    title: a.msg,
                    icon: "none"
                });
            },
            fail: function(t) {
                console.log(t);
            }
        });
    },
    goBack: function() {
        wx.navigateBack({
            delta: 1
        });
    }
});